package net.lmc.realtime.traffic.mapper;


import net.lmc.realtime.traffic.bean.TransportationMetrics;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author 26374
 */
public interface TransportationMapper {
    @Select("select totalFlow, avgSpeed, congestionRate, congestionLevel, ts\n" +
            "from traffic_monitoring.dws_city_overview\n" +
            "WHERE toDate(toDateTime(ts / 1000)) = #{date}\n" +
            "order by ts desc limit 1")
    List<TransportationMetrics> selectCityOverview(@Param("date") String date);

}
